'use strict';
var fs = require('fs');
let max = 0;
for (var i = 1; i <=5; i++) {
    let count = Math.ceil(Math.random() * 1000 + 1);//Math.ceil获取整数 Math.random()0-1的随机小数不包括1
    fs.writeFileSync(i + ".txt", count + "");
}
var name;
for (var ai = 1; ai <= 5; ai++) {
    let data=fs.readFileSync(ai + ".txt");
    console.log(data.toString())
    if(max<Number(data.toString())){
        max=Number(data.toString());
        name=ai;
    }
}
setTimeout(function(){
    console.log("最大的文件是"+name+".txt");
    console.log("最大文件值为："+max);
},1000)
